//
//  MQSocietyViewCell.m
//  MQ
//
//  Created by lanou on 15/10/26.
//  Copyright © 2015年 徐永祥. All rights reserved.
//

#import "MQSocietyViewCell.h"
#import <UIImageView+WebCache.h>
@implementation MQSocietyViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        _pictureView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, (screen_width-30)/2-10, 100)];
        [self.contentView addSubview:_pictureView];
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 115, (screen_width-30)/2-10, 40)];
        _titleLabel.numberOfLines = 0;
        _titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14];
        [self.contentView addSubview:_titleLabel];
        
        _playTimeLabel = [[UILabel alloc]initWithFrame:CGRectMake(2, 80, (screen_width-30)/2-80, 20)];
        _playTimeLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:13];
        _playTimeLabel.textColor = [UIColor whiteColor];
        [self.pictureView addSubview:_playTimeLabel];
        
        
        _timeLabel = [[UILabel alloc]initWithFrame:CGRectMake((screen_width-30)/2-45, 80, 40, 20)];
        _timeLabel.textColor = [UIColor whiteColor];
        _timeLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:13];
        [self.pictureView addSubview:_timeLabel];
        
    }
    return self;
}

-(void)configCellWithModel:(MQSocietyBodyList*)model
{
    [self.pictureView sd_setImageWithURL:[NSURL URLWithString:model.bodyModel.image]];
    self.titleLabel.text = model.bodyModel.title;
    self.timeLabel.text =[NSString stringWithFormat:@"%02ld:%02ld",model.bodyModel.memberItem.duration/60,model.bodyModel.memberItem.duration%60];
    self.playTimeLabel.text =[NSString stringWithFormat:@"%ld次播放",model.bodyModel.playTime];
    
    
}


@end
